#include <iostream>

#include <gtest/gtest.h>

#include "melon/client/thrift_client_pool.h"
#include "obbt/adapters/obbt_remark_adapter.h"

#include "BbtServiceCommon_types.h"

using obbt::ObbtRemarkServiceClient;
using melon::client::ClientPool;

using namespace obbt;

void * ThreadFun(void *) {
  for (int i = 0; i < 1; ++i) {
    int ret = ObbtRemarkAdapter::Instance().UpdateRemark(123,456,"呵呵asdfassd哈哈",2);
    std::cout << "Push Message " << i << " ret=" << ret << std::endl;

    std::string remark;
    ObbtRemarkAdapter::Instance().GetRemark(remark, 123, 456, 2);
    std::cout << "remark=" << remark << std::endl;
  }

  return NULL;
}

const int kThreadCount = 1;

int main() {
  LOG_INIT("./test.log", "DEBUG");
  pthread_t ts[kThreadCount];

  for (int i = 0; i < kThreadCount; ++i) {
    pthread_create(&ts[i], NULL, ThreadFun, NULL);
  }

  for (int i = 0; i < kThreadCount; ++i) {
    pthread_join(ts[i], NULL);
  }
  return 0;
} 
